package com.ridu.project.beshid.repository;


import com.ridu.project.beshid.entity.BeshUserEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Administrator on 2017/3/7.
 */
@Repository
public interface BeshUserRepository extends JpaRepository<BeshUserEntity, Long>,JpaSpecificationExecutor<BeshUserEntity> {
    BeshUserEntity findByBeshId(String mobile);

    @Transactional
    @Query("from BeshUserEntity t where t.beshId in ?1")
    List<BeshUserEntity> findByMobiles(List<String> list);
}
